package com.edu.zut.hb.software.server.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.edu.zut.hb.software.server.pojo.Teacher;
import com.edu.zut.hb.software.server.service.ITeacherService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author zhoubin
 * @since 2021-08-15
 */
@RestController
@RequestMapping("/class")
public class ClassController {

    @Autowired
    private ITeacherService teacherService;
    @ApiOperation(value = "获取班级数据")
    @GetMapping(value = "/{classroom}")
    public List<Teacher> getOneClass(@PathVariable("classroom") String classroom){
        return teacherService.getOneClass(classroom);
   }
    @ApiOperation(value = "获取所有老师")
    @GetMapping("/")
    public List<Teacher> getAllTeacher() {
        return teacherService.list(new QueryWrapper<Teacher>().last("limit 150"));
    }

}


